package com.changgou.service.goods.service.impl;

import cn.hutool.core.convert.Convert;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.changgou.goods.pojo.Spec;
import com.changgou.service.goods.dao.SpecMapper;
import com.changgou.service.goods.service.SpecService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class SpecServiceImpl extends ServiceImpl<SpecMapper, Spec> implements SpecService {
    @Resource
    private SpecMapper specMapper;

    @Override
    public List<Spec> findListByCategoryName(String categoryName) {
        List<Spec> specList = specMapper.findListByCategoryName(categoryName);
//        for (Spec spec : specList) {
//            String[] options = spec.getOptions().split(",");
//            spec.setOptions(Convert.toStr(options));
//        }
        return specList;
    }
}
